﻿{include file="common/header" /}
<article class="page-container">
	<form action="" method="post" class="form form-horizontal" id="myform">
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>WareHouse：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<span class="select-box">
					<select name="warehouse" id="warehouse" class="select valid" style="">
					<option value="1600">Richmond</option>
					<option value="1200">Milpitas</option>
					<option value="1050">Maywood</option>
					<option value="1400">Stockton</option>
				</select>
				</span>
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>Driver Id：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="" placeholder="Driver Id" id="driver_id" name="driver_id">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>NickName：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="" placeholder="nickname" id="nickname" name="nickname">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>Address：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="" placeholder="Address" id="address" name="address">
			</div>
		</div>

		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>City：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="" placeholder="City" id="city" name="city">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>Phone：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="" placeholder="Phone" id="phone" name="phone">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>Regoin：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="" placeholder="Regoin" id="regoin" name="regoin">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>Start Location：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<span class="select-box">
					<select name="start_location" id="start_location" class="select valid" style="">

                            {{volist name="wareHouse" id="vo"}}
                            <option value="{{$vo->location_code}}">{{$vo->name}}</option>
                            {{/volist}}
				</select>
				</span>
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>End Location：</label>
			<div class="formControls col-xs-8 col-sm-9">
					<span class="select-box">
					<select name="end_location"  id="end_location" class="select valid" style="">
					<option value="Home">Home</option>
						    {{volist name="wareHouse" id="vo"}}
                            <option value="{{$vo->location_code}}">{{$vo->name}}</option>
                            {{/volist}}
				</select>
				</span>
			</div>
		</div>

		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>Departure Time：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="time" class="input-text" value="08:30" placeholder="Departure Time" id="departure_time" name="departure_time">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>End Time：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="time" class="input-text" value="17:30" placeholder="Phone" id="end_time" name="end_time">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>Work Hours：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="8" placeholder="Work Hours" id="work_hours" name="work_hours">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red"></span>Notes：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="" placeholder="Notes" id="notes" name="notes">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red"></span>Status：</label>
			<div class="formControls col-xs-8 col-sm-9">
					<span class="select-box">
					<select name="status"  id="status" class="select valid" style="">
					<option value="1">正常</option>
					<option value="0">禁用</option>
				</select>
				</span>
			</div>
		</div>
		<div class="row cl">
			<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
				<button type="button" class="btn btn-success radius" id="save-btn" name="admin-role-save"><i class="icon-ok"></i> 确定</button>
			</div>
		</div>
	</form>
</article>
<script>
	$('#save-btn').click(function () {
        $.ajax({
            type: "POST",
            dataType: "json",
            url: "{{:url('driver/create','',false)}}" ,
            data: $('#myform').serialize(),
            success: function (result) {
                if (result.code == 200) {
                    layer.msg('添加成功!',{icon:1,time:1000},function (index) {
                        parent.getData();
                    });
                }else{
                    layer.msg(result.msg,{icon:1,time:1000});
				}
            },
            error : function() {
                layer.msg('异常!',{icon:1,time:100000000});

            }
        });
    })
</script>
{include file="common/header" /}